home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGASIC
/
BASLIB1.LZH
/
BOXES.BAS
< prev
next >
Wrap
BASIC Source File
|
1987-03-26
|
1KB
|
64 lines
'Paint & tile options by John Craig, Jeff Bretz
'Converted to Quickbasic 2.01 & other rwts by Dennis Dreyer, 3/87
'BOXES.BAS
cls
locate 1,10,0:Print "Boxes"
locate 3,10:Print "A demonstration of Tiling & solid fill."
Locate 4,10:Print "1) = Solid fill..... 2) = Tiling....."
Locate 8,10:print "Select number <1> or <2> ?--->"
locate 12,10:print "During the DEMO push any key to quit...."
ANS:
k$=inkey$
if k$="1" then goto INITIALIZE1
If k$="2" then goto INITIALIZE2
GOTO ANS
INITIALIZE1:
clear:screen 1:color 0,0:cls
size=12
Randomize CVD(TIME$)
RANDOM1:
X=int(rnd*size)*319/size
y=int(rnd*size)*199/size
colr=int(1+3*rnd)
pnt=colr+1
if pnt=4 then pnt=1
line (x,y)-(x+319/size,y+199/size),colr,B
paint (x+1,y+1),pnt,colr
If inkey$="" then goto RANDOM1
END
INITIALIZE2:
clear:screen 1:color 1,0:cls
size=5
randomize timer
RANDOM2:
X=int(rnd*size)*319/size
Y=int(rnd*size)*199/size
colr=int(1+3*rnd)
RANDOMPATTERN:
pnt$=""
for I= 1 to int(8*rnd)+1
pnt$=pnt$+chr$(int(rnd*256))
next I
if pnt$=string$(len(pnt$),0) then goto randompattern
line (x,y)-(x+319/size,y+199/size),0,BF
line (x,y)-(x+319/size,y+199/size),colr,B
paint (x+1,y+1),pnt$,colr
if inkey$="" then goto RANDOM2
END